<template>
  <div class="book-info">
    <div class="thum">
      <img :src="info.image" mode='aspectFill' class="back">
      <div class="block-back"></div>
      <img :src="info.image" alt="" mode="aspectFit" class="img">
      <div class="title">
        <span class="tit">{{info.title}}</span>
        <span class="aut">{{info.author}}</span>
      </div>
    </div>
    <div class="other-info">
      <div class="row text-primary">
        <div class="right">{{info.rate}}<Rate :value='info.rate'></Rate></div>
        <div class="left">
          <img :src="userinfo.img" alt="">
          {{userinfo.name}}
        </div>
      </div>
      <div class="row">
        <div class="right">CNY:{{info.price}}元</div>
        <div class="left">
          出版社：{{info.publisher}}
        </div>
      </div>
      <div class="row">
        <div class="tags" :key="index" v-for="(tag,index) in info.tags">{{tag}}</div>
      </div>
    </div>
    <div class="summary">
      <p :key="i" v-for="(sum,i) in info.summary">{{sum}}</p>
    </div>
  </div>
</template>

<script>
import Rate from '@/components/Rate'
export default {
  components:{
    Rate
  },
  props:['info'],
  computed:{
    userinfo(){
      return this.info.user_info||{}
    }
  }
}
</script>

<style lang='scss' scoped>
.book-info{
  .thum{
    height: 500rpx;
    overflow: hidden;
    width: 750rpx;
    position: relative;
    .back{
      width: 100%;
      height: 500rpx;
      filter: blur(15px);
      margin: 0 auto;
      overflow: hidden;
    }
    .block-back{
      width: 100%;
      height: 500rpx;
      background: rgba(0, 0, 0, .3);
      position:absolute;
      top: 0;
      left: 0;
    }
    .img{
      position: absolute;
      top: 30rpx;
      left: 0;
      height: 300rpx;
      left:0; right:0;
      margin:auto;
    }
    .title{
      position: absolute;
      top:350rpx;
      left: 0;
      right: 0;
      margin: auto;
      text-align: center;
      display: block;
      padding: 0 10px;
      span{
        display: block;
        color: #fff;
      }
      .tit{
        font-size: 14px;
      }
      .aut{
        font-size: 12px;
        margin-top: 10rpx;
      }
    }
  }
  .other-info{
    margin: 5px;
    .row{
      width: 100%;
      display: inline-block;
      font-size: 14px;
      .left{
        img{
          width: 15px;
          height: 15px;
          border-radius: 50%;
          vertical-align: middle;
        }
      }
      .right{
        float: right;
      }
      .tags{
        display: inline-block;
        color: #ea5149;
        padding: 1px 2px;
        border: 1px solid #ea5149;
        margin-right: 5px;
        margin-top: 5px;
        border-radius: 5px;
      }
    }
  }
  .summary{
    padding: 5px;
    font-size: 14px;
    color: #222;
    text-indent: 2em;
    line-height: 20px;
    text-align: justify;
    padding-bottom: 10px;
  }
}

</style>
